#include "stdafx.h"
#include "xxximp.h"

XxxImp::XxxImp()
{

}

XxxImp::~XxxImp()
{

}



HRESULT STDMETHODCALLTYPE XxxImp::Op0( LPCWSTR lpOpName )
{
	HRESULT hr = S_OK;

	if ( lpOpName )
	{
		std::wcout << L"Op0:" << lpOpName << std::endl;
	}

	return hr;
}

HRESULT STDMETHODCALLTYPE XxxImp::Op1( LPCWSTR lpOpName )
{
	HRESULT hr = S_OK;

	if ( lpOpName )
	{
		std::wcout << L"Op1" << lpOpName << std::endl;
	}

	return hr;
}

HRESULT WINAPI CreateXxx( REFIID riid, void** ppvObj )
{
	if (__uuidof(IXxx) == riid || IID_IUnknown == riid)
	{
		IXxx* pIXxx = new ComObject<XxxImp>;
		if (NULL == pIXxx)
			return E_OUTOFMEMORY;

		pIXxx->AddRef();

		*ppvObj = pIXxx;

		return S_OK;
	}

	return S_FALSE;
}